package JackSu.面试题;

import java.util.ArrayList;

public class cpuHigh {


    public static void main(String[] args) {

        ArrayList<highCpu> list = new ArrayList<>();
        Thread thread = new Thread(() -> {
          int i=0;
          while (true){
              highCpu jack = new highCpu("jack", i);
              list.add(jack);
              i++;
              System.out.println("==>size:"+list.size());
          }

        });
     thread.setName("高占用");
     thread.run();
    }



    public static class highCpu{

        private  String name;
        private  int age;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public highCpu(String name, int age) {
            this.name = name;
            this.age = age;
        }

        public highCpu() {
        }
    }


}
